<template>
	<view class="content">
		<nav-header bgColor="bg-custom-color" :isBack="true">
			<block slot="content">GHMI</block>
		</nav-header>

		<!-- <view class="cu-form-group">
			<view class="title">账号</view>
			<input placeholder="请填写对方账号" name="mobile" v-model="mobile" />
		</view>
		<view class="cu-form-group">
			<view class="title">金额</view>
			<input placeholder="请填写转出金额,不得小于10" name="cash_count" v-model="cash_count" />
		</view> -->

		<view style="margin-top: 30px;">
			<view style="text-align: center;color:white;font-size: 16px;" class="">{{$t('wallet.walletAddr')}}</view>
			<view style="text-align: center;color:#edb43b;height: 40px;line-height: 40px;font-size: 16px;" class="">{{ghmiAddr}}</view>
		</view>
		<view class="padding flex flex-direction back" style="margin-bottom: 60px;">
			<button class="cu-btn bg-et margin-tb-sm lg" @tap="copy">{{$t('wallet.copyAdrr')}}</button>
		</view>
	</view>

</template>

<script>
	var t
	export default {
		data() {
			return {
				mobile: '',
				cash_count: '',
				userInfo: null,
				ghmiAddr:'',
			}
		},
		onLoad() {
			t = this
			this.$i18n.locale = t.$common.localRead("local")
			t.userInfo = $common.getUser()
			if (!t.userInfo) {
				$common.notLoginUser()
			}
			console.info(t.userInfo)
			t.getData();
		},
		methods: {
			copy(){
				uni.setClipboardData({
					data: t.ghmiAddr,
					success: function(data) {
						t.$common.showToast(t.$t('wallet.copySuccess'))
					},
					fail: function(err) {
						t.$common.showToast(t.$t('wallet.copyfail'))
					},
					complete: function(res) {}
				})
			},
			getData() {
				let data = {
					id: t.userInfo.id,
				}
				t.$fetch.request('userInfo/getGhumiAddr', data, "GET").then((res) => {
					console.info(res)
					if (res.code == 200) {
						t.ghmiAddr = res.data.ghmiAddr
					} else {
						$common.showToast(res.msg);
					}
				}).catch((e) => {})
			}
		}
	}
</script>

<style>
	.cu-form-group {
		background-color: #121E2E;
	}

	.cu-form-group .title {
		color: #E6EEFF;
	}

	.uni-input-placeholder {
		color: #5C7392;
	}

	.cu-form-group uni-input {
		color: #5C7392 !important;
	}

	.uni-input-input {
		color: #5C7392 !important;
	}

	.wallet .cu-item:after {
		border-bottom: 0px solid #ddd;
	}

	.wallet .cu-item {
		background-color: #121E2E;
	}

	.lc2-son-par {
		display: flex;
		height: 30px;
		line-height: 30px;
	}

	.lc2-son1-text {
		color: #5C7392;
		flex: 1;
		text-align: center;
	}

	.lc2-son2-text {
		flex: 1;
		text-align: center;
	}

	.cu-list.card-menu {
		overflow: hidden;
		margin-right: 0px;
		margin-left: 0px;
		border-radius: 0px;
	}

	.et-content {
		display: flex;
	}

	.et-text {
		flex: 1;
	}

	.lc1 {
		height: 60px;
		line-height: 60px;
		display: flex;
	}

	.lc1-box {
		/* display: inline-table; */
		flex: 1;
	}

	.lc1-1 {
		margin-left: 10px;
		font-weight: bold;
	}
</style>
